/**
 * 
 */
package org.cuatrovientos.loopsexercise6;

import java.util.Scanner;

/**
 * @author beatriz_sola
 *
 */
public class LoopsExercise6 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		 //Request number
		  String line = "";
		  int number = 0;
		  int result = 0;
		  Scanner reader = new Scanner(System.in);
		  
		  System.out.println("Enter a number: ");
		  line = reader.nextLine();
		  number = Integer.parseInt(line);
		  
		  
		  //Loop
		  for (int i=number; i>0; i--){
		  System.out.print(number + " * " + i + " = " + number * i + ", ");
		  number = number * i;
		  result = result + number;
		  }
		  System.out.print("TOTAL: " + result);
		  
		 }
	

	}

}
